package dyyx.jdbc;

import java.sql.Connection;
import java.util.Date;
import java.util.List;

import dyyx.util.JdbcUtil;

public class QueryTest {

	public static void main(String[] args) throws Exception {

		System.out.println("hello,QueryTest," + new Date());

		Connection cn = JdbcUtil.getConn();
		// autoCommit false
		System.out.println("cn=" + cn + ",autoCommit=" + cn.getAutoCommit());
		// id UInt32,col1 String,col2 String,create_date date
		String sql = "select * from  test01 order by id ";

		List list = JdbcUtil.queryList(cn, sql);
		for (Object item : list) {
			System.out.println(item);
		}

		System.out.println("list size " + list.size());

		list = JdbcUtil.queryList(cn, sql, 2);
		for (Object item : list) {
			System.out.println(item);
		}

		System.out.println("list size " + list.size());

		JdbcUtil.close(cn);

	}

}
